#ifndef SERWERMANAGER_H
#define SERWERMANAGER_H

#include <iostream>
#include <cstdlib>
#include <QTimer>
#include "serwerinfo.h"
#include <QObject>
#include <QWidget>
#include <QGroupBox>
#include <QLayout>
#include <QTableWidget>
#include "serwerlabelinfo.h"
#include <QPushButton>
#include <QLineEdit>
#include <QTabWidget>
#include <QPixmap>
#include <QPainter>
#include "players_graph.h"
#include <QFileDialog>


class SerwerManager: public QWidget
{
Q_OBJECT
public:
    SerwerManager(QString ip, int port, int localport, int id,QWidget *parrent=0);

    //glowne okno
    QWidget *menu;
    QVBoxLayout *menulay;
    QVBoxLayout *main;


    QTabWidget *tab_widget;
    //widgety stron
    QWidget *basic_info_1;
    QWidget *basic_players_2;
    QWidget *rcon_console_3;
    QWidget *advance_players_4;

    //glowny modul
    SerwerInfo *info;

    //glowne widgety graficzne
    QString ip;
    int port;

    //widgety graficzne 1 strona
    SerwerLabelInfo *LabelInfo;
    QTableWidget *players_table;
    QTableWidget *rules;
    QTextBrowser *browser;
    QLineEdit *rcon_password;
    QPushButton *login;
    QLabel *status_rcon;
    QPushButton *wyjscie;


    //widgety graficzne 2 strona
    players_graph *basic_player_graph;
    QPushButton *save_image_players;

    //widgety graficzne strona 3
    QTextBrowser *console_output;
    QLineEdit *console_input;
    QPushButton *send;
    QPushButton *clear;


    //opcje sql
    QPushButton *dodaj_do_bazy;

    bool serwer_is_set;

    void init_basic_info_tab();
    void init_basic_players_tab();
    void init_rcon_console_tab();
    void init_advanceplayers_tab();

public slots:
    void send_rcon_password();
    void rcon_status(int id, bool st);

};

#endif
